﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

using NUnitResults;

namespace NUnitResultsExplorer
{
    [ValueConversion(typeof(Status), typeof(String))]
    public class StatusToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Status s = (Status)value;

            var statusses = new Dictionary<Status, String>
            {
                { Status.Error, "Error" },
                { Status.Failed,"Failed" },
                { Status.Ignored, "Ignored" },
                { Status.Inconclusive, "Inconclusive" },
                { Status.Success, "Success" },
                { Status.NonRunnable, "Non-runnable" },
                { Status.Unrecognised, "Unrecognised" }
            };

            return statusses[s];
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
